Skip to content

test: improve transaction_manager branch coverage to 59%#58

Merged
poyrazK merged 8 commits intomainfrom
test/txn-manager-coverage
Apr 21, 2026
Merged

test: improve transaction_manager branch coverage to 59%#58
poyrazK merged 8 commits intomainfrom
test/txn-manager-coverage

Conversation

@poyrazK
Copy link
Copy Markdown
Owner

@poyrazK poyrazK commented Apr 21, 2026

Summary

  • Add 27 new tests (53 total) covering commit/abort/prepare paths, DML with indexes, lock management, overflow handling, error paths
  • Add fault_injection.hpp infrastructure for testing error branches
  • Add FAULT_LOG_COMMIT/ABORT/PREPARE modes to LogManager
  • Add UndoLog::UNKNOWN type and add_undo_log_for_test() helper
  • Reduce MAX_COMPLETED from 100 to 10 for easier overflow testing

Test plan

  • make transaction_manager_tests && ./transaction_manager_tests - all 53 tests pass
  • gcov -b - branches taken-at-least-once: 44% -> 59%

Coverage

  • Lines executed: 97%
  • Branches taken-at-least-once: 59% (227/386)

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

Warning

Rate limit exceeded

@poyrazK has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 6 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 15 minutes and 6 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c9c50901-6388-4874-817e-f756d57e0751

📥 Commits

Reviewing files that changed from the base of the PR and between adfa4c5 and edaed3b.

📒 Files selected for processing (7)
  • include/common/fault_injection.hpp
  • include/recovery/log_manager.hpp
  • include/transaction/transaction.hpp
  • src/recovery/log_manager.cpp
  • src/transaction/transaction_manager.cpp
  • tests/recovery_tests.cpp
  • tests/transaction_manager_tests.cpp
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/txn-manager-coverage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

poyrazK and others added 2 commits April 21, 2026 10:02
The return type was changed from lsn_t to bool in a previous refactor.
Update the test to use the LogRecord's lsn_ field after successful
append, and reference qlog2.lsn_ instead of the removed local variable.
Copy link
Copy Markdown
Owner Author

@poyrazK poyrazK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's okay to merge

@poyrazK poyrazK merged commit 0163d0a into main Apr 21, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant